<?php
include('../../../common/basic.php');
include('../admincore/message.php');
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>留言管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all" />
	<link rel="stylesheet" href="../../css/message.css" media="all" />
</head>
<body class="childrenBody">
	<form class="layui-form">
	<?php
$result = mysql_query('select * from aikcms_basic where id = 1');
					if( $row = mysql_fetch_array($result)){
					?>		
					
		<blockquote class="layui-elem-quote news_search">
			<div class="layui-inline"><form method="get" >
		    <div class="layui-input-inline">
		    	<input  name="wd" placeholder="请输入留言内容" class="layui-input search_input" type="text" >
		    </div><button id="search" class="layui-btn" type="submit" >查询</button>
		</form></div>
		</blockquote><?php }?>
		<table class="layui-table msg_box" lay-skin="line">
			<colgroup>
				<col width="45%">
				<col width="25%">
				<col width="15%">
				<col>
			</colgroup>
			<tbody>
			<?php
			$sql = 'select * from aikcms_gbook where aik_gbook_reply="0" order by id desc';
									$pager = page_handle('page',20,mysql_num_rows(mysql_query($sql)));
									$result = mysql_query($sql.' limit '.$pager[0].','.$pager[1].'');
								if (isset($_GET['wd'])) {
								$sql = 'select * from aikcms_gbook where aik_gbook_reply="0" and aik_gbook_content like "%'.$_GET['wd'].'%" order by id desc';
								$pager = page_handle('page',20,mysql_num_rows(mysql_query($sql)));
								$result = mysql_query($sql.' limit '.$pager[0].','.$pager[1].'');
							}
									while($row= mysql_fetch_array($result)){
									?>
			<tr>  <td class="msg_info"> 
			<img src="<?php echo get_user_img($row['aik_gbook_userid'])?>" width="50" height="50"> 
			<div class="user_info">
			<h2><?php echo get_user_name($row['aik_gbook_userid'])?></h2>
			<p><?php echo htmlspecialchars_decode($row['aik_gbook_content']);?></p>    
			</div>  </td>  
			<td class="msg_time"><?php echo date("Y-m-d H:i:s",$row['aik_gbook_time'])?></td>  <td class="msg_reply"><?php echo get_gbook_reply($row['id'])?></td>  <td class="msg_opr"><a class="layui-btn layui-btn-mini"
			href="message_reply.php?id=<?php echo $row['id'];?>"><i class="layui-icon"></i> 回复</a> <a class="layui-btn layui-btn-danger layui-btn-mini"  href="?del=<?php echo $row['id']?>"><i class="layui-icon"></i> 删除</a> </td>
			</tr>	 
			 <?php }?>
			 
			 
			</tbody>
		</table><div class="layui-inline">		
				  <div id="page" class="page"><div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-0">
						 <?php echo page_show($pager[2],$pager[3],$pager[4],2);?>
						  </div></div>
			</div>
	</form>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript" src="message.js"></script>
</body>
</html>